package cate.game.chat.msg;

import cate.game.chat.ChatPublicItem;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBChat;
import cate.game.role.Role;
import easy.java.dev.note.NoteField;

import java.util.List;

@ClientMsg(title = "公共频道历史消息 の 返回")
public class ChatPublicHistoryResp implements MsgOutput{
    @NoteField(value = "频道")
    public byte channel;

    @NoteField(value = "该频道的最近30条历史消息")
    public List<ChatPublicItem> itemList;

    public ChatPublicHistoryResp(){}

    public ChatPublicHistoryResp(byte channel, Role role) {
        this.channel = channel;
        this.itemList = role.getGame().chat.history.getPublicListForMaster(channel, role);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBChat.PUBLIC_HISTORY_RESP;
    }
}
